#include "Enemy1Manager.h"
#include "ICollidable.h"
#include "ConfigManager.h"
#include "Enemy.h"
#include "Enemy1.h"

namespace PeanutQuest {

	Enemy1Manager::Enemy1Manager(std::string id) : cg::Entity(id) {
	}
	Enemy1Manager::~Enemy1Manager() {
	}

	void Enemy1Manager::init() {

		config = (ConfigManager*)cg::Registry::instance()->get("ConfigManager");

		enemies.push_back(new Enemy1(cg::Vector3f(config->sugar1)));
		enemies.push_back(new Enemy1(cg::Vector3f(config->sugar2)));
	}

	void Enemy1Manager::update(unsigned long elapsed_millis) {

		for(std::vector<Enemy*>::iterator it = enemies.begin(); it != enemies.end(); ++it){
			(*it)->update(elapsed_millis);
		}

	}

	void Enemy1Manager::draw() {

		for(std::vector<Enemy*>::iterator it = enemies.begin(); it != enemies.end(); ++it){
			(*it)->draw();
		}

	}

	void Enemy1Manager::deleteEnemy(Enemy* enemy) {
		enemies.erase(std::remove(enemies.begin(), enemies.end(), enemy), enemies.end());
	}

}